// 定义 Region 模型
import { DataTypes, Model } from 'sequelize'
import { sequelize } from '../config/database'  // 假设你的数据库配置在这里

export class Region extends Model {
  declare id: number;
  declare code: string;
  declare parentCode: string;
  declare name: string;
  declare level: number;
}

Region.init({
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  name: DataTypes.STRING,
  code: DataTypes.STRING,
  level: DataTypes.INTEGER,
  parentCode: DataTypes.STRING
}, {
  sequelize,
  modelName: 'Region'
}) 